#include <iostream>
using namespace std;
class base
{
public:
    int f() { return 0; }
};
class derived : public base
{
public:
    int a, b, c;
    void set(int x, int y, int z)
    {
        a = x;
        b = y;
        c = z;
    }
    int f() { return a + b + c; }
};
int main()
{
    base b;
    derived d;
    cout << b.f() << ",";
    d.set(3, 5, 7);
    cout << d.f() << ",";
    base &p = d;
    cout << p.f() << endl;
    return 0;
}